package com.weather.Dao;

import com.weather.domain.Weather;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author WangKaiP
 * @Description
 * @create 2021-11-03 13:08
 */
@Repository
public interface WeatherDao {

    //根据ID查询天气情况
    @Select("select * from weather where id = #{id}")
    public Weather findOneByID(Integer id);

    //向数据库插入天气信息信息
    @Insert("insert into weather(Uid,temperature,humidity,co,voc,wind_speed,wind_direction,air,longitude,latitude,Now_date)" +
            "values(#{uid},#{temperature},#{humidity},#{co},#{voc},#{wind_speed},#{wind_direction},#{air},#{longitude},#{latitude},#{Now_date})")
    public void insertWeather(Weather weather);

}
